package net.cyndeline.itemEventFactory

/**
 * Filters a list of targets to a subset that fulfills a certain criteria.
 * Note that these criteria are not ones that can be described using
 * target-specific conditions, but requires a finished list of targets to
 * reason about the entire set as a whole.
 * 
 * Because of that, selectors should only be applied to a list of targets after
 * all target/event pairs have been calculated.
 * 
 * An example is target distance from the user. A target-specific condition may 
 * specify that only targets within 5 tiles from the user should be targeted. 
 * A selector on the other hand, may select the 5 closest targets from the list 
 * containing targets from within 5 tiles, regardless how many tiles from the 
 * user they actually are.
 */
trait TargetSelector {
  
  /**
   * @return An event result, filtered based on some selection process.
   */
  def selectTargets(preliminaryResult: ActionResult): ActionResult
}